"""
对象和类
- 实例化一个对象
- 对象属性使用 __init__
- 类方法
"""


# 1. 实例化一个对象
class Student:
    # 构造器
    def __init__(self, first_name, last_name, major):
        self.first_name = first_name
        self.last_name = last_name
        self.major = major

    def change_major(self, major):
        self.major = major
        print(self.first_name + ' ' + self.last_name + ' ' + self.major)


student_1 = Student('Max', 'Griffen', '美容美发')
student_2 = Student('Bill', 'Gates', 'Computer science')
student_3 = Student('刘', '二狗', '美容美发')
print(student_1)
print(student_2)
student_3.change_major('挖掘机')
